<template>
    <div class="w-50 mx-auto pt-5">
        <div class="fs-4 text-center text-light mb-3">
            请选择仓库进入数据中心
        </div>
        <div class="row row-cols-2">
            <div class="col p-3"><button class="btn btn-lg btn-primary w-100 py-3"
                    @click="selectWarehouse('WH101')">1号库</button></div>
            <div class="col p-3"><button class="btn btn-lg btn-primary w-100 py-3"
                    @click="selectWarehouse('WH102')">2号库</button></div>
        </div>
    </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import useWarehouseStore from '@/stores/warehouse.js';

const router = useRouter();

const warehouseStore = useWarehouseStore();

function selectWarehouse(warehouse) {
    warehouseStore.setWarehouse(warehouse);
    router.push('/index');
}

</script>